QTMTB 24 - Embedding Movies (Multiple) Into a Macintosh File
Technical Q&A's
QTMTB 24 - Embedding Movies (Multiple) Into a Macintosh File (1-May-95)
Q Is there a way to embed a QuickTime movie into a Macintosh file containing
non-QuickTime stuff and get the Movie Toolbox to play the movie back correctly?
If so, can we pass the same movie handle to QuickTime for Windows and get it to
play back the same data from the same file?
A To add QuickTime movie data to non-QuickTime files, just store the movie data
in the file using FlattenMovieData with the flattenAddMovieToDataFork flag.
Since FlattenMovieData will simply append to a data fork of a file, you can
pass it any data file and it will append the movie data to that file. QuickTime
doesn't care what's stored before or after the movie data, as long as you don't
reposition the movie data within the data file. If you do, the movie references
will be incorrect since they aren't updated when you edit the file. The
returned movie (from FlattenMovieData) will properly resolve to that data file.
You can then save this movie in the data fork with PutMovieIntoDataFork or in
the resource fork with AddMovieResource. If the movie is saved in the data
fork, it can be retrieved by both QuickTime and QuickTime for Windows with
NewMovieFromDataFork.
You can, in fact, store multiple movies simply by calling FlattenMovieData and
PutMovieIntoDataFork several times on the same file. Each FlattenMovieData call
appends new data, assuming the createMovieFileDataCurFile flag isn't set. See also the article Cross-Platform Compatibility and Multiple-Movie Files by
John Wang in develop #17.